package com.itheima.article.feign;

import com.itheima.article.dto.ArticleInfoDto;
import com.itheima.common.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient(name = "leadnews-article",contextId = "apArticleFeign")
public interface ApArticleFeign {

    /**
     * 同步文章微服务到文章
     * @param dto
     * @return
     */
    @PostMapping("/api/apArticle/saveArticleInfo")
    ResultVo saveArticleInfo(ArticleInfoDto dto);

    /**
     * 通过文章id查询作者名称
     * @param articleId
     * @return
     */
    @GetMapping("/api/apArticle/getAuthorName/{articleid}")
    ResultVo<String> getAuthorName(@PathVariable(value = "articleid")Long articleId);



}
